home *** CD-ROM | disk | FTP | other *** search
/ Medabots Cardz / Medabots CD Cardz Sumilidon.bin / mac / assets / sumilidon.dxr / 00068_Script_68 < prev    next >
Text File  |  2001-12-07  |  8KB  |  281 lines

  1. property minuteman, tempdigits, tempscore, digit_one, digit_two, digit_three, digit_four, brassurl, tempscoreone, tempscoretwo, tempscorethree
  2. global thescore, finalcode, scoredigits, timescore, gotobrassurl, myFile, squam, oldscore
  3.  
  4. on beginsprite me
  5.   set the floatPrecision = 0
  6.   squam = getOSdirectory()&"\"
  7.   if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
  8.   myFile = new(xtra "fileio") -- Create an instance of FileIO
  9.   --  openFile(myFile,the moviePath&"info.txt",1) --Open the file with read access
  10.   openFile(myFile,squam&"infos.txt",1) --Open the file with read access
  11.   myVariable = readFile(myFile) --set the variable 'myVariable' to the text of the file 'info.txt'
  12.   if readFile(myFile)=VOID then --checks to see if this file exists
  13.     thescore = 0
  14.   else
  15.     thescore = myVariable
  16.     closeFile(myFile) -- Close the file
  17.   end if
  18.   myFile = 0 -- Dispose of the instance
  19.   
  20.   --  
  21.   --  minuteman = timescore/60
  22.   --  if minuteman < 120 then
  23.   --    thescore = 500
  24.   --  else if minuteman > 119 and minuteman < 300 then
  25.   --    thescore = 400
  26.   --  else if minuteman > 299 and minuteman < 600 then
  27.   --    thescore = 300
  28.   --  else if minuteman > 599 and minuteman < 1200 then
  29.   --    thescore = 200
  30.   --  else if minuteman > 1199 and minuteman < 2000 then
  31.   --    thescore = 150
  32.   --  else
  33.   --    thescore = 100
  34.   --  end if
  35.   --  thescore = thescore + oldscore
  36.   put thescore into member("holdscore")
  37.   
  38.   if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
  39.   myFile = new(xtra "fileio")    -- Create an instance of FileIO
  40.   --  openFile (myFile, the moviePath &"info.txt",0)--Open the file with R/W access  
  41.   openFile (myFile, squam&"infos.txt",0)--Open the file with R/W access  
  42.   delete(myFile) --deletes the file
  43.   --  createFile (myFile, the moviePath &"info.txt") --creates the file again
  44.   createFile (myFile, squam&"infos.txt") --creates the file again
  45.   --  openFile(myFile,the moviePath &"info.txt",0) --Open the file with R/W access
  46.   openFile(myFile, squam&"infos.txt",0) --Open the file with R/W access
  47.   --  mySaveString = thescore --puts the contents of the field 'input' into the variable mySaveString
  48.   mySaveString = member("holdscore").text
  49.   writeString(myFile,mySaveString) --writes text to the file
  50.   
  51.   closeFile(myFile) -- Close the file 
  52.   myFile = 0 -- Dispose of the instance
  53.   
  54.   --  put minuteman into member ("timedisplay")
  55.   --  
  56.   brassurl = "http://www.medabots.com/rewards/coding/rewards_give.pl?a=dflbnljksbv"
  57.   
  58.   if thescore > 10000 then
  59.     thescore = 9999
  60.   end if
  61.   
  62.   if thescore > 0 and thescore <10 then
  63.     scoredigits = 1
  64.     tempscore = thescore
  65.     tempdigits = 1
  66.   else if thescore > 9 and thescore <100 then
  67.     scoredigits = 2
  68.     tempscore = thescore
  69.     tempdigits = 2
  70.   else if thescore >99 and thescore < 1000 then
  71.     scoredigits = 3
  72.     tempscore = thescore
  73.     tempdigits = 3
  74.   else if thescore >999 and thescore < 10000 then
  75.     scoredigits = 4
  76.     tempscore = thescore
  77.     tempdigits = 4
  78.   end if
  79.   
  80.   --  Four Figures
  81.   if tempdigits = 4 then
  82.     if tempscore > 999 and tempscore <2000 then
  83.       digit_four = "q"
  84.       tempscore = tempscore - 1000
  85.       tempdigits = 3
  86.     end if
  87.     if tempscore > 1999 and tempscore <3000 then
  88.       digit_four = "u"
  89.       tempscore = tempscore - 2000
  90.       tempdigits = 3
  91.     end if
  92.     if tempscore > 2999 and tempscore <4000 then
  93.       digit_four = "j"
  94.       tempscore = tempscore - 3000
  95.       tempdigits = 3
  96.     end if
  97.     if tempscore > 3999 and tempscore <5000 then
  98.       digit_four = "c"
  99.       tempscore = tempscore - 4000
  100.       tempdigits = 3
  101.     end if
  102.     if tempscore > 4999 and tempscore <6000 then
  103.       digit_four = "k"
  104.       tempscore = tempscore - 5000
  105.       tempdigits = 3
  106.     end if
  107.     if tempscore > 5999 and tempscore <7000 then
  108.       digit_four = "b"
  109.       tempscore = tempscore - 6000
  110.       tempdigits = 3
  111.     end if
  112.     if tempscore > 6999 and tempscore <8000 then
  113.       digit_four = "r"
  114.       tempscore = tempscore - 7000
  115.       tempdigits = 3
  116.     end if
  117.     if tempscore > 7999 and tempscore <9000 then
  118.       digit_four = "w"
  119.       tempscore = tempscore - 8000
  120.       tempdigits = 3
  121.     end if
  122.     if tempscore > 8999 and tempscore <10000 then
  123.       digit_four = "n"
  124.       tempscore = tempscore - 9000
  125.       tempdigits = 3
  126.     end if
  127.   end if
  128.   
  129.   
  130.   
  131.   
  132.   --  Three Figures
  133.   if tempdigits = 3 then
  134.         if tempscore < 99 then
  135.       digit_three = "x"
  136.       tempscore = tempscore
  137.       tempdigits = 2
  138.     end if
  139.     if tempscore > 99 and tempscore <200 then
  140.       digit_three = "q"
  141.       tempscore = tempscore - 100
  142.       tempdigits = 2
  143.     end if
  144.     if tempscore > 199 and tempscore <300 then
  145.       digit_three = "u"
  146.       tempscore = tempscore - 200
  147.       tempdigits = 2
  148.     end if
  149.     if tempscore > 299 and tempscore <400 then
  150.       digit_three = "j"
  151.       tempscore = tempscore - 300
  152.       tempdigits = 2
  153.     end if
  154.     if tempscore > 399 and tempscore <500 then
  155.       digit_three = "c"
  156.       tempscore = tempscore - 400
  157.       tempdigits = 2
  158.     end if
  159.     if tempscore > 499 and tempscore <600 then
  160.       digit_three = "k"
  161.       tempscore = tempscore - 500
  162.       tempdigits = 2
  163.     end if
  164.     if tempscore > 599 and tempscore <700 then
  165.       digit_three = "b"
  166.       tempscore = tempscore - 600
  167.       tempdigits = 2
  168.     end if
  169.     if tempscore > 699 and tempscore <800 then
  170.       digit_three = "r"
  171.       tempscore = tempscore - 700
  172.       tempdigits = 2
  173.     end if
  174.     if tempscore > 799 and tempscore <900 then
  175.       digit_three = "w"
  176.       tempscore = tempscore - 800
  177.       tempdigits = 2
  178.     end if
  179.     if tempscore > 899 and tempscore <1000 then
  180.       digit_three = "n"
  181.       tempscore = tempscore - 900
  182.       tempdigits = 2
  183.     end if
  184.   end if
  185.   
  186.   
  187.   --  Two Figures
  188.   if tempdigits = 2 then
  189.     if tempscore < 10 then
  190.       digit_two = "x"
  191.       tempscore = tempscore
  192.       tempdigits = 1
  193.     end if
  194.     
  195.     if tempscore > 9 and tempscore <20 then
  196.       digit_two = "q"
  197.       tempscore = tempscore - 10
  198.       tempdigits = 1
  199.     end if
  200.     if tempscore > 19 and tempscore <30 then
  201.       digit_two = "u"
  202.       tempscore = tempscore - 20
  203.       tempdigits = 1
  204.     end if
  205.     if tempscore > 29 and tempscore <40 then
  206.       digit_two = "j"
  207.       tempscore = tempscore - 30
  208.       tempdigits = 1
  209.     end if
  210.     if tempscore > 39 and tempscore <50 then
  211.       digit_two = "c"
  212.       tempscore = tempscore - 40
  213.       tempdigits = 1
  214.     end if
  215.     if tempscore > 49 and tempscore <60 then
  216.       digit_two = "k"
  217.       tempscore = tempscore - 50
  218.       tempdigits = 1
  219.     end if
  220.     if tempscore > 59 and tempscore <70 then
  221.       digit_two = "b"
  222.       tempscore = tempscore - 60
  223.       tempdigits = 1
  224.     end if 
  225.     if tempscore > 69 and tempscore <80 then
  226.       digit_two = "r"
  227.       tempscore = tempscore - 70
  228.       tempdigits = 1
  229.     end if
  230.     if tempscore > 79 and tempscore <90 then
  231.       digit_two = "w"
  232.       tempscore = tempscore - 80
  233.       tempdigits = 1
  234.     end if
  235.     if tempscore > 89 and tempscore <100 then
  236.       digit_two = "n"
  237.       tempscore = tempscore - 90
  238.       tempdigits = 1
  239.     end if
  240.     
  241.   end if
  242.   --  One Figure
  243.   if tempdigits = 1 then
  244.     if tempscore = 0 then
  245.       digit_one = "x"
  246.     else if tempscore = 1 then
  247.       digit_one = "q"
  248.     else if tempscore = 2 then
  249.       digit_one = "u"
  250.     else if tempscore = 3 then
  251.       digit_one = "j"
  252.     else if tempscore = 4 then
  253.       digit_one = "c"
  254.     else if tempscore = 5 then
  255.       digit_one = "k"
  256.     else if tempscore = 6 then
  257.       digit_one = "b"
  258.     else if tempscore = 7 then
  259.       digit_one = "r"
  260.     else if tempscore = 8 then
  261.       digit_one = "w"
  262.     else if tempscore = 9 then
  263.       digit_one = "n"
  264.     end if
  265.   end if
  266.   
  267.   if scoredigits = 1 then
  268.     finalcode = digit_one
  269.   else if scoredigits = 2 then
  270.     finalcode = digit_two&digit_one
  271.   else if scoredigits = 3 then
  272.     finalcode = digit_three&digit_two&digit_one
  273.   else if scoredigits = 4 then
  274.     finalcode = digit_four&digit_three&digit_two&digit_one
  275.   end if
  276.   
  277.   --  put brassurl&finalcode into member("urldisplay")
  278.   gotobrassurl = brassurl&finalcode
  279. end
  280.  
  281.